package com.xc.disk.bean;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>项目名称: Stars</p>
 * <p>描述: 分页查询实体类</p>
 * <P>创建人: 小程</p>
 * <P>创建人邮箱: 779943476@qq.com</p>
 * <p>创建时间: 2019/7/1</p>
 *
 * @version v1.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class PagingBean<T> extends QueryBean {

    /**
     * 全部数据，默认false
     */
    private Boolean allData = false;

    /**
     * 每页多少条数据
     */
    private Integer size;
    /**
     * 第几页
     */
    private Integer current;
    /**
     * 查询数据条件
     */
    private T data;

    public PagingBean() {
    }

    public PagingBean(QueryBean queryBean) {
        super(queryBean.getSortFields(), queryBean.getRule(), queryBean.getLikeFields());
    }

    public PagingBean(Integer size, Integer current) {
        this.size = size;
        this.current = current;
    }
}
